import units from '@/assets/scripts/units.js'
import dataInterface from '@/assets/scripts/dataInterface.js'

const Toc_IM_Service ={
	el:null,
	share(thirdInfo,_el){
		console.log(thirdInfo)
		this.el = _el;
		if(thirdInfo.modeInfo.shareToAccountMemIds.length>0){
			//
		}else{
			this.el.$router.push({name: 'main'});
			this.el.$nextTick(()=>{
				this.el.$bus.emit('tocIMheaderController', {
		  			handlers:'messageList',
		  			title:'消息',
		  			rc:'',
		  			invokeComponent:{
		  				instance:'choosePerson',
						componentsData:{
							headerTitle:'添加发送成员',
							isCraeteChat:true,
							autoToChat:false,
							allowAdd:true,
							allowDel:true
						},
						emitInvoking:data=>{
							this.el.$store.commit({
								type:'sendMessage',
								chatId:data.chatId,
								data:thirdInfo.modeInfo.chatMsg.chatData,
								chatMsgType:thirdInfo.modeInfo.chatMsg.msgType
							});
							this.el.$root.$router.push({
								path: 'chat',
								query:{chatId:data.chatId}
							});
						}
		  			}
		  		});
			});
		}
	}
}

export default Toc_IM_Service